Optimal. Leaf size=73 \[ a^2 (2 B+C) x+\frac {a^2 (B+2 C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {4157, 4103,
4081, 3855} \begin {gather*} \frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {a^2 (B+2 C) \tanh ^{-1}(\sin (c+d x))}{d}+a^2 x (2 B+C)+\frac {C \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3855
Rule 4081
Rule 4103
Rule 4157
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos (c+d x) (a+a \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac {C \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}+\int \cos (c+d x) (a+a \sec (c+d x)) (a (B-C)+a (B+2 C) \sec (c+d x)) \, dx\\ &=\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}-\int \left (-a^2 (2 B+C)-a^2 (B+2 C) \sec (c+d x)\right ) \, dx\\ &=a^2 (2 B+C) x+\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}+\left (a^2 (B+2 C)\right ) \int \sec (c+d x) \, dx\\ &=a^2 (2 B+C) x+\frac {a^2 (B+2 C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.37, size = 143, normalized size = 1.96 \begin {gather*} \frac {a^2 \left (2 B c+c C+2 B d x+C d x-B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+B \sin (c+d x)+C \tan (c+d x)\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.96, size = 88, normalized size = 1.21
method | result | size |
derivativedivides | \(\frac {a^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \tan \left (d x +c \right )+2 a^{2} B \left (d x +c \right )+2 a^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} B \sin \left (d x +c \right )+a^{2} C \left (d x +c \right )}{d}\) | \(88\) |
default | \(\frac {a^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \tan \left (d x +c \right )+2 a^{2} B \left (d x +c \right )+2 a^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} B \sin \left (d x +c \right )+a^{2} C \left (d x +c \right )}{d}\) | \(88\) |
risch | \(2 a^{2} B x +a^{2} x C -\frac {i a^{2} B \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{2} B \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i a^{2} C}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(163\) |
norman | \(\frac {\left (-2 a^{2} B -a^{2} C \right ) x +\left (-4 a^{2} B -2 a^{2} C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 a^{2} B -a^{2} C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a^{2} B +a^{2} C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a^{2} B +a^{2} C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (4 a^{2} B +2 a^{2} C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {4 a^{2} B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} B \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a^{2} C \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 a^{2} \left (B -C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (B +C \right ) a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}+\frac {a^{2} \left (B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{2} \left (B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(330\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 105, normalized size = 1.44 \begin {gather*} \frac {4 \, {\left (d x + c\right )} B a^{2} + 2 \, {\left (d x + c\right )} C a^{2} + B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, C a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B a^{2} \sin \left (d x + c\right ) + 2 \, C a^{2} \tan \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.34, size = 108, normalized size = 1.48 \begin {gather*} \frac {2 \, {\left (2 \, B + C\right )} a^{2} d x \cos \left (d x + c\right ) + {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (B a^{2} \cos \left (d x + c\right ) + C a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 2 B \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 157 vs.
\(2 (73) = 146\).
time = 0.51, size = 157, normalized size = 2.15 \begin {gather*} \frac {{\left (2 \, B a^{2} + C a^{2}\right )} {\left (d x + c\right )} + {\left (B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.93, size = 161, normalized size = 2.21 \begin {gather*} \frac {B\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {4\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________